﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleGameEngine
{
    public class BaseShip : GameSprite
    {

        public const string _baseShipBitmap = @"graphics\Shooter40x32.bmp";
        private const double _speed = 150;
        private const int _AngularSpeed = 180;


        public BaseShip(GameState gameState, float x, float y)
            : base(gameState, x, y, _baseShipBitmap)
        {
        }


        public override void Update(double elapsedTime)
        {
            //double velocity = 0.0;
            //Set the velocity of the sprite based on which keys are pressed
            AngularVelocity = 0;
            if (GameKeyboard.Left)
            {
                //velocity += -_speed;
                AngularVelocity += -_AngularSpeed;
            }
            if (GameKeyboard.Right)
            {
                //velocity += _speed;
                AngularVelocity += _AngularSpeed;
            }
            //Velocity.X = (float)velocity;
            //Angle = AngularVelocity;

            //Perform any animation
            base.Update(elapsedTime);

            //Limit the animation to the screen
            if (Location.X < 0) Location.X = 0;
            if (Location.X > _gameState.GameArea.Width - Size.Width) Location.X = _gameState.GameArea.Width - Size.Width;
        }
    }
}
